﻿<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>New Sylk record definition.</Title>
      <Description>Creates a Enum, Field, and class for a SylkRecord.</Description>
      <Shortcut>SYLK</Shortcut>
    </Header>
    <Snippet>
      <Declarations>
        <Literal Editable="true">
          <Default>NEW</Default>
          <ID>SylkRecordName</ID>
          <ToolTip>The name of this record in SYLK</ToolTip>
        </Literal>
      </Declarations>
      <References>
        <Reference>
          <Assembly>System</Assembly>
        </Reference>
      </References>
      <Code Language="CSharp">
<![CDATA[
    /// <summary>
    /// Enumerates the possible fields in a <see cref="$SylkRecordName$Record"/>
    /// </summary>
    public enum $SylkRecordName$RecordFieldType
    {
        //TODO:Complete here other fields type.
        /// <summary>
        /// Unknown field type.
        /// </summary>
        Unknown = 100
    }

    /// <summary>
    /// Object representation of field of a Sylk record of type '$SylkRecordName$'
    /// </summary>
    public class $SylkRecordName$RecordField : FieldBase<$SylkRecordName$RecordFieldType>
    {
        /// <summary>
        /// Instanciate a new <see cref="$SylkRecordName$RecordField"/>
        /// </summary>
        public $SylkRecordName$RecordField()
            : base($SylkRecordName$RecordFieldType.Unknown, String.Empty) { }

        /// <summary>
        /// Instanciate a new <see cref="$SylkRecordName$RecordField"/>
        /// </summary>
        /// <param name="pType">Type of this field.</param>
        /// <param name="pValue">The value contained by this field.</param>
        public $SylkRecordName$RecordField($SylkRecordName$RecordFieldType pType, string pValue)
            : base(pType, pValue) { }

        //TODO:Add here accessors or methods to Get/Set specific values for this $SylkRecordName$RecordField
    }

    /// <summary>
    /// Object representation of a Sylk record of type '$SylkRecordName$'.
    /// </summary>
    public class $SylkRecordName$Record : RecordBase<$SylkRecordName$RecordField, $SylkRecordName$RecordFieldType>
    {
        //TODO:Complete this array.
        private static readonly $SylkRecordName$RecordFieldType[] _MANDATORY_FIELDS = new $SylkRecordName$RecordFieldType[] {  };
        
        /// <summary>
        /// Instanciate a new <see cref="$SylkRecordName$Record"/>
        /// </summary>
        public $SylkRecordName$Record(string pLineWithoutId)
            : base(RecordType.$SylkRecordName$, pLineWithoutId, $SylkRecordName$RecordFieldType.Unknown) { }
        
        /// <summary>
        /// Get mandatory fields for this record.
        /// </summary>
        /// <returns></returns>
        public override System.Collections.Generic.IEnumerable<$SylkRecordName$RecordFieldType> GetMandatoryFields()
        {
            return _MANDATORY_FIELDS;
        }
        
        /// <summary>
        /// Get the unknown field type.
        /// </summary>
        /// <returns></returns>
        public override $SylkRecordName$RecordFieldType GetUnknownFieldType()
        {
            return $SylkRecordName$RecordFieldType.Unknown;
        }
        
        //TODO:Add here accessors or methods to Get/Set specific values for this $SylkRecordName$RecordField
    }
]]>
      </Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>